package com.bdqn.service.impl;

import java.time.LocalDateTime;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.bdqn.entity.PsInspectiontaskDetail;
import com.bdqn.entity.PsUser;
import com.bdqn.mapper.PsInspectiontaskDetailMapper;
import com.bdqn.service.IPsInspectiontaskDetailService;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;


/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author dede
 * @since 2020-05-23
 */
@Service

public class PsInspectiontaskDetailServiceImpl extends ServiceImpl<PsInspectiontaskDetailMapper, PsInspectiontaskDetail>
		implements IPsInspectiontaskDetailService {

	@Autowired
	PsInspectiontaskDetailMapper psInspectiontaskDetailMapper;

	@Override
	public List<PsInspectiontaskDetail> fetchBugInfo() {
		// TODO Auto-generated method stub
		return psInspectiontaskDetailMapper.fetchBugInfo();
	}

	@Override
	public PsInspectiontaskDetail fetchBugInfoById(Integer id) {
		// TODO Auto-generated method stub
		return psInspectiontaskDetailMapper.fetchBugInfoById(id);
	}

	@Override
	public void confirm(Long id, Long bugLevelId) {
		PsInspectiontaskDetail pid = new PsInspectiontaskDetail();
		pid.setId(id);
		pid.setBugLevelId(bugLevelId);
		pid.updateById();
	}

	@Override
	public PsInspectiontaskDetail selectInsDetailByMainId(Integer id) {
		return psInspectiontaskDetailMapper.selectInsDetailByMainId(id) ;
	}

	@Override
	public List<PsInspectiontaskDetail> selectRequest() {
		return psInspectiontaskDetailMapper.selectRequest();
	}

	@Override
	public PsInspectiontaskDetail selectDetailById(Integer id) {
		QueryWrapper<PsUser> qw=new QueryWrapper<>();
		qw.eq("d.id", id);
		return psInspectiontaskDetailMapper.selectDetailById(qw);
	}

	@Override
	public boolean add(Integer taskid, long l, Long poleid, int i, Double intactRate, long m, long n, String bugdesc,
			String usercode, String username, int j, int k, String string, LocalDateTime ltime, LocalDateTime ltime2,
			LocalDateTime ltime3, LocalDateTime discovertime) {
		
		return psInspectiontaskDetailMapper.add(taskid,l,poleid,i,intactRate,m,n,bugdesc,
			usercode,username, j, k, string,ltime, ltime2,
			ltime3, discovertime);
	}

}
